
import sys,os
import optparse

import pathlib
toolname = pathlib.Path(__file__).absolute().parts[-1][2:-5]

def func(isHelp=False):
    if(isHelp):
        return [toolname,"~ %s"%(toolname),"=os.walk"]
    parser = optparse.OptionParser("")
    parser.add_option("-p", '--path', dest="walkPath", default = "./")
#    parser.add_option("-r", '--norecursive', dest="noRecursive",action="store_true", default = False)
    options, args = parser.parse_args()
    
    def walk(root):
        root.replace("\\","/")
        if(root[-1]=="/"):root = root[:-1]
        for root,directorys,fileList in os.walk(root):
            for file in fileList:
                print(root.replace('\\','/') + '/' + file)
#            if(not options.noRecursive):
#                for i in directorys:walk(i)
            
    walk(options.walkPath)

"""
root = 'D:/Program_Files/'
   
for dir in os.listdir(root):
    if(dir[:7] == 'program'):
        for program in os.listdir(root+dir):
            print(root+dir+'/'+program)
"""